import React from 'react'
import { Radio } from 'antd';

export default function MyRadio(props) {
    const [value, setValue] = React.useState(1);

    const onChange = e => {
        console.log('radio checked', e.target.value);
        setValue(e.target.value);
    };

    return (
        <>
            <Radio.Group onChange={onChange} value={value}>
                {
                    props.List.map((item, index) => {
                        return <Radio value={item} key={index}>{item}</Radio>
                    })
                }
            </Radio.Group>
        </>
    )
}
